/*
 * CoutTaskDescription.java
 * 
 * last update: 15.01.2010 by Stefan Saru
 * 
 * author:	Alec(panovici@elcom.pub.ro)
 * 
 * Obs:
 */

package engine;

class CoutTaskDescription extends InstructionDescription{
	int id;
	ExpressionDescription ex;

	CoutTaskDescription(int delayBefore, int line,
			NameSpaceDescription nsd, ExpressionDescription ex){
		super(delayBefore, line, nsd);
		this.ex = ex;
	}

	DefaultInstruction instantiate(NameSpace ns)throws ParseException{

		Expression exInstance;
		try{
			exInstance = ex.instantiate(ns);
		}catch(ParseException ex){
			xConsole.dumpStack(ex);
			throw new ParseException(super.toString() + " error:" + ex);
		}

		return new CoutTask(ns, delayBefore, this, exInstance,
				next == null ? null : next.instantiate(ns));
	}

}

